<div class="p-head">
    <b class="c3">记账</b>
    <div class="r">
    </div>
    <div id="desc">
        <?= isset($familyinfo['name']) ? $familyinfo['name'] . ($familyinfo['desc'] ? " - " . $familyinfo['desc'] : '') : '记录每天生活的点点滴滴。。。' ?>
    </div>
</div>
<div class="col_box">
    <div class="col_two clear" id="billform">
        <dl id="billtype">
            <dt>类型：</dt>
            <dd>
                <input type="radio" name="row[type]" class="radio" id="r_expense" value="expense" <?= checkchecked("expense", $show['type']) ?> /><label for="r_expense">支出</label>
                <input type="radio" name="row[type]" class="radio" id="r_income" value="income" <?= checkchecked("income", $show['type']) ?>/><label for="r_income">收入</label>
            </dd>
        </dl>
        <form class="validform" method="post" action="/bill/edit/<?= $show['id'] ?>/" rel="edit">
            <dl><dt>时间：</dt>
                <dd><input type="date" name="row[occurtime]" id="occurtime_expense" class="input" value="<?= date("Y-m-d", $show['occurtime']) ?>" title="点击选择日期" size="10" style="width:100px;" datatype="date" errormsg="日期输入错误！" autocomplete="off" /></dd>
            </dl>
            <dl><dt>类别：</dt>
                <dd>
                    <select name="row[category_id]" id="category_list_expense" class="select <?= $show['type'] == 'income' ? 'hidden' : '' ?>" datatype="*" nullmsg="请选择分类">
                        <?= get_category_option_full('expense', $show['type'] == 'income' ? null : $show['category_id']); ?>
                    </select>
                    <select name="" id="category_list_income" class="select <?= $show['type'] == 'expense' ? 'hidden' : '' ?>" datatype="*" nullmsg="请选择分类">
                        <?= get_category_option_full('income', $show['type'] == 'expense' ? null : $show['category_id']); ?>
                    </select>
                </dd></dl>
            <dl><dt>账户：</dt>
                <dd>
                    <select name="row[account_id]" id="account_id_expense" class="select" datatype="*" nullmsg="请选择账户">
                        <?= get_account_option(null, $show['account_id']); ?>
                    </select>
                </dd></dl>
            <dl><dt>金额：</dt><dd><input type="number" name="row[amount]" id="money_expense" value="<?= $show['amount'] ?>" class="input calculator" size="10" maxlength="8" datatype="dec1" nullmsg="金额不能为空" errormsg="金额格式错误" /></dd></dl>
            <dl><dt>说明：</dt><dd><textarea name="row[memo]" cols="30" rows="4" class="textarea"><?= $show['memo'] ?></textarea></dd></dl>
            <dl><dt>&nbsp;</dt>
                <dd>
                    <input type="checkbox" name="row[notinfamily]" value="1" <?= checkchecked(0, $show['family']) ?> id="c_notinfamily_expense" class="checkbox" /> <label for="c_notinfamily_expense">不在家庭中显示</label>
                </dd>
            </dl>
            <dl><dt>&nbsp;</dt>
                <dd>
                    <a href="javascript:;" class="btn btn_s submit"><span><b class="icon icon-ok"></b><em>提交</em></span></a>
                    <span class="poststate"><em>&nbsp;</em><b></b></span>
                </dd></dl>
        </form>
    </div>
</div>
<script type="text/javascript">
    KS.common.load('bill.edit');
    KS.common.validform("#billform", function() {
        $("#nav ul li a[href='/mobile/bill/']").click();
    });
</script>